package com.kingwang.training.designpattern.principles.ocp.bo;

import lombok.Data;

/**
 * 梯形
 */
@Data
public class Trapezoid implements Shape {
    private Double top;

    private Double bottom;

    private Double height;

    @Override
    public Double calculateArea() {
        return (this.top + this.bottom) * this.height / 2;
    }
}
